package cn.school.controller.app;

import cn.school.common.api.CommonPage;
import cn.school.common.api.CommonResult;
import cn.school.sys.entity.SysUser;
import cn.school.sys.service.SysUserService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/app/userInfo")
public class AppUserInfoController {
    @Resource
    SysUserService userService;

    @PostMapping(value = "/userList")
    public CommonResult<CommonPage<SysUser>> userList(@RequestBody SysUser user) {
        IPage<SysUser> userList = userService.getUserList(user);
        return CommonResult.success(CommonPage.restPage(userList));
    }
}
